package com.wkq.move.module.main.ui.adapter

import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.wkq.move.module.main.ui.fragment.TvListFragment

/**
 * 作者:吴奎庆
 *
 *
 * 时间:2019-12-21
 *
 *
 * 用途:
 */
class ClassificationFragmentPagerAdapter(var context: Context, fm: FragmentManager) :
    FragmentPagerAdapter(fm) {
    override fun getItem(position: Int): Fragment {
        var fragment: Fragment? = null
        when (position) {
            0 -> fragment = TvListFragment.newInstance("/list-lishi-all-1.html")
            1 -> fragment = TvListFragment.newInstance("/list-mohuan-all-1.html")
            2 -> fragment = TvListFragment.newInstance("/list-jingsong-all-1.html")
            3 -> fragment = TvListFragment.newInstance("/list-dushi-all-1.html")

            4 -> fragment = TvListFragment.newInstance("/list-zongyi-all-1.html")
            5 -> fragment = TvListFragment.newInstance("/list-katong-all-1.html")
        }
        return fragment!!
    }

    override fun getCount(): Int {
        return 6
    }

}